<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="color" name="xxx" id="color">
    <button id="setZhuTi">设置主题</button>

    <script>
        // 获取元素
        var body = document.body
        var btn=document.querySelector('button');
        // var color=document.querySelector('#color').value;

        // 点击按钮，背景色等于color
        btn.addEventListener('click',function(){
            var color=document.querySelector('#color').value;
            document.body.style.backgroundColor=color;
          
        
        })




    </script>
    
</body>
</html>